package com.ludomancy.sora;

import java.util.Vector;

public class Vertex
{
	public double px;
	public double py;
	public double old_px;
	public double old_py;
	public double forceX;
	public double forceY;
	public Vector connections = new Vector();
	
	public Vertex(double x, double y, double speedX, double speedY)
	{
		px = x;
		py = y;
		old_px = x - speedX;
		old_py = y - speedY;
	}
		
	public void move(double x, double y)
	{
		px += x;
		py += y;
		old_px += x;
		old_py += y;
	}
	
	public double velX()
	{
		return px-old_px;
	}
	
	public double velY()
	{
		return py-old_py;
	}	

	public void bounce()
	{
		double tx = old_px;
		double ty = old_py;
		old_px = px;
		old_py = py;
		px = tx;
		py = ty;
	}
}
